<template>
  <app-page fill isHome>
    <!-- <StatData /> -->
    <div class="container">
      <Task />
      <Board />
    </div>
  </app-page>
</template>
<script setup>
import { getPlatform } from '@/api'

import StatData from './components/StatData.vue'
import Task from './components/task/Task.vue'
import Board from './components/board/Board.vue'

import { useHomeStore } from './home-store.js'

const platforms = ref([])
const platformObj = reactive({})

const store = useHomeStore()

onMounted(() => {
  getPlatform({
    page: 1,
    page_size: 999,
  }).then(res => {
    platforms.value = res.data.out_platform.map(item => {
      platformObj[item.bc_type] = item
      return item
    })
  })
})

provide('/home', {
  platforms,
  platformObj,
  store,
})
</script>
<style lang="scss" scoped>
.container {
  margin-top: 12px;
  display: flex;
  width: 100%;
  height: 100%;
  background: #fff;
  padding: 12px;
  overflow: hidden;
}
</style>
